﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace IotS.Core.Repositories
{
    public interface IBaseRepository<in TKey, T> : IDisposable
    {
        Task<T> InsertAsync(T entity, CancellationToken cancellationToken = default(CancellationToken));

        T UpdateAsync(TKey id, T entity);

        void Remove(TKey id);

        void Remove(T entity);

        Task<T> Get(TKey id);

        IQueryable<T> Query();
    }

    public interface IBaseRepository<T> : IBaseRepository<int, T> { }
}
